//
//  NewsModel.swift
//  KaMengApplication
//
//  Created by DUONIU_MAC on 2018/9/19.
//  Copyright © 2018年 DUONIU_MAC. All rights reserved.
//

import UIKit

@objcMembers
class NewsModel: NSObject,NSCoding {

    var image : String? //图片
    var title : String? //标题
    var text : String? //内容
    var time : String? //时间
    var href : String? //链接
    
    override init() {
        super.init()
        
        
    }
    
    func encode(with aCoder: NSCoder) {
        
        aCoder.encode(self.image, forKey: "image")
        aCoder.encode(self.title, forKey: "title")
        aCoder.encode(self.text, forKey: "text")
        aCoder.encode(self.time, forKey: "time")
        aCoder.encode(self.href, forKey: "href")
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init()
        
        self.image = aDecoder.decodeObject(forKey: "image") as? String
        self.title = aDecoder.decodeObject(forKey: "title") as? String
        self.text = aDecoder.decodeObject(forKey: "text") as? String
        self.time = aDecoder.decodeObject(forKey: "time") as? String
        self.href = aDecoder.decodeObject(forKey: "href") as? String
        
        
    }
    
}
